package com.myself.community;

import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import javax.annotation.PostConstruct;

@Slf4j
@SpringBootApplication
public class CommunityApplication {

    //后续版本不存在此问题
    /*@PostConstruct
    public void init() {
        // 解决netty启动冲突问题
        // redis -> netty; es -> netty 当redis启动后es会检查netty，发现已设置则会不启动，因此报错
        System.setProperty("es.set.netty.runtime.available.processors","false");
        // 从Netty4Utils.setAvailableProcessors()可发现
    }*/

    public static void main(String[] args) {
        SpringApplication.run(CommunityApplication.class, args);
        log.info("项目启动成功...");
    }

}
